<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>转让</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="{{ url_for('static',filename='layuiadmin/layui/css/layui.css') }}" media="all">
    <link rel="stylesheet" href="{{ url_for('static',filename='layuiadmin/style/admin.css') }}" media="all">
</head>
<body>

{#<div class="layui-fluid">#}
{#    <div class="layui-row layui-col-space15">#}
{#        <div class="layui-col-md12">#}
{#            <div class="layui-card">#}
{#                <div class="layui-card-header">协议转让</div>#}
{#                <div class="layui-card-body" pad15>#}
{##}
{#                    <div class="layui-form" lay-filter="">#}
{#                        <div class="layui-form-item">#}
{#                            <label class="layui-form-label">转让人手机号</label>#}
{#                            <div class="layui-input-inline">#}
{#                                <input type="text" name="sell_id"#}
{#                                       class="layui-input">#}
{#                            </div>#}
{#                        </div>#}
{##}
{#                        <div class="layui-form-item">#}
{#                            <label class="layui-form-label">数量</label>#}
{#                            <div class="layui-input-inline">#}
{#                                <input type="text" name="num" lay-verify="required"#}
{#                                       autocomplete="off" class="layui-input">#}
{#                            </div>#}
{#                        </div>#}
{##}
{##}
{#                        <div class="layui-form-item">#}
{#                            <label class="layui-form-label">被转让人手机号</label>#}
{#                            <div class="layui-input-inline">#}
{#                                <input type="text" name="buy_id" lay-verify="required"#}
{#                                       autocomplete="off" id="LAY_password" class="layui-input">#}
{#                            </div>#}
{#                        </div>#}
{##}
{#                        <div class="layui-form-item">#}
{#                            <div class="layui-input-block">#}
{#                                <button class="layui-btn" lay-submit lay-filter="doSubmit">点击确认</button>#}
{#                            </div>#}
{#                        </div>#}
{#                    </div>#}
{##}
{#                </div>#}
{#            </div>#}
{#        </div>#}
{#    </div>#}
{#</div>#}

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">系统配货</div>
                <div class="layui-card-body" pad15>

                    <div class="layui-form" lay-filter="">

                        <div class="layui-form-item">
                            <div class="layui-col-md4">
                                <label class="layui-form-label">账号：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="user_phone"
                                           class="layui-input" placeholder="请输入手机号">
                                </div>
                            </div>
                        </div>


                        <div class="layui-form-item">
                            <div class="layui-col-md4">
                                <label class="layui-form-label">商品：</label>
                                <div class="layui-input-block">
                                    <select name="goods_id" id="goods_id" lay-filter="goods_id">
                                        <option value="">请选择</option>
                                        {% for i in goods %}
                                             <option value="{{ i.id }}" class="form-control">{{ i.name }}</option>

                                        {% endfor %}

                                    </select>
                                </div>
                            </div>
                        </div>

                         <div class="layui-form-item">
                            <div class="layui-col-md4">
                                <label class="layui-form-label">数量：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="num"
                                           class="layui-input" placeholder="请输入数量">
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit lay-filter="doSubmit2">点击确认</button>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>


<script src="{{ url_for('static',filename='layuiadmin/layui/layui.js') }}"></script>
<script>
    layui.config({
        base: '../../static/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'set', 'table', 'jquery', 'layer', 'form', 'upload'], function () {

        var $ = layui.jquery;


        /*layui.form.on("submit(doSubmit)", function (obj) {
            //序列化表单数据
            var data = obj.field;
            console.log(data);
            layer.confirm('您确定要转让么?', function (index) {
                $.ajax({
                    url: '/cms/transfer_deal/',
                    type: "POST",
                    data: data,
                    success: function (data) {
                        if (data['code'] == 200) {
                            //关闭弹框
                            //显示提示框
                            layer.msg("成功", {icon: 6});

                            window.location.reload();
                        } else {
                            layer.msg(data['message'], {icon: 5});
                        }
                    }
                });
                return false;
            })
        });*/


        layui.form.on("submit(doSubmit2)", function (obj) {
            //序列化表单数据
            var data = obj.field;
            console.log(data);
            layer.confirm('您确定要系统配货么?', function (index) {
                $.ajax({
                    url: '/cms/user_transfer_trade/',
                    type: "POST",
                    data: data,
                    success: function (data) {
                        if (data['code'] == 200) {
                            //关闭弹框
                            //显示提示框
                            layer.msg("成功", {icon: 6});

                            window.location.reload();
                        } else {
                            layer.msg(data['message'], {icon: 5});
                        }
                    }
                });
                return false;
            })
        });


    });
</script>
</body>
</html>